﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace celinda.Formulaire
{
    public partial class BaseForm : ComponentFactory.Krypton.Toolkit.KryptonForm
    {
        public String NameForm { get; set; }

        public BaseForm()
        {
            InitializeComponent();
        }

        private void kBtnAjout_Click(object sender, EventArgs e)
        {
            this.Ajout();
        }

        virtual protected void Ajout()
        { }

        private void kBtnSupprime_Click(object sender, EventArgs e)
        {
            this.Supprime();
        }

        virtual protected void Supprime()
        { }

        private void kBtnDupplique_Click(object sender, EventArgs e)
        {
            this.Dupplique();
        }

        virtual protected void Dupplique()
        { }

        private void kBtnValide_Click(object sender, EventArgs e)
        {
            this.Valide();
        }

        virtual protected void Valide()
        { }

        private void kBtnActiveDesactive_Click(object sender, EventArgs e)
        {
            this.ChangeEtat();
        }

        virtual protected void ChangeEtat()
        { }

        private void kBtnPrint_Click(object sender, EventArgs e)
        {
            this.Print();
        }

        virtual protected void Print()
        { }

        private void tssMode_TextChanged(object sender, EventArgs e)
        {
            this.TssModeTextChanged();
        }

        virtual protected void TssModeTextChanged()
        {
            if (tssMode.Text.Equals(Class.Const.ModeCreation.ToString()))
            {
                kBtnActiveDesactive.Enabled = false;
                kBtnSupprime.Enabled = false;
                kBtnAjout.Enabled = false;
                kBtnDupplique.Enabled = false;
                kBtnPrint.Enabled = false;
                kBtnValide.Enabled = true;
            }
            else
            {
                kBtnActiveDesactive.Enabled = true;
                kBtnSupprime.Enabled = true;
                kBtnAjout.Enabled = true;
                kBtnDupplique.Enabled = true;
                kBtnValide.Enabled = true;
                kBtnPrint.Enabled = true;
            }
        }


    }
}
